Skip to content

Conversation

@lewisacidic
Copy link

Now have nested colors in theme. For example:

// theme passed to ThemeProvider
const theme = {
  ui: {
    color: '#424242'
  }
}

// Button can be styled as below:
const Button = styled.button`
  color: ${theme.ui.color};
  &:hover {
    color: ${theme.ui.color.darken(0.1)};
  }
`

I'm pretty new to JS and moved the code around a bit, so feel free to edit/close without merging.

Now have nested colors in theme. For example:

```javascript
// theme passed to ThemeProvider
const theme = {
  ui: {
    color: '#424242'
  }
}

// Button can be styled as below:
const Button = styled.button`
  color: ${theme.ui.color};
  &:hover {
    color: ${theme.ui.color.darken(0.1)};
  }
`
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant